#-*- encoding: utf-8 -*-
'''
Created on 2011-4-16

@author: Bob
'''
from jxgame.globals.GlobalDef import GS_FREE, GS_PLAYING

                        
KIND_ID                 = 2701
GAME_PLAYER             = 3
GAME_NAME               = "斗地主"

#游戏状态
GS_LAND_FREE            = GS_FREE
GS_LAND_SCORE           = GS_PLAYING
GS_LAND_PLAYING         = GS_PLAYING + 1

class CMD_Packet:
    SubID               = 0
    CMD                 = None                                                
                                                
########################_#######################_#######################
#服务器命令结构
                                                                                                    
SUB_S_SEND_CARD			= 100					#发牌命令
SUB_S_LAND_SCORE		= 101					#叫分命令
SUB_S_GAME_START		= 102					#游戏开始
SUB_S_GAME_STARTEX		= 110					#游戏开始扩展
SUB_S_OUT_CARD			= 103					#用户出牌
SUB_S_PASS_CARD			= 104					#放弃出牌
SUB_S_GAME_END			= 105					#游戏结束
SUB_S_UserDouble		= 106					#加倍


class CMD_S_SCENE_Free:
    BaseScore           = 0                     #基础积分
    
class CMD_S_SCENE_CallScore:
    LandScore           = 0                     #地主分数
    BaseScore           = 0                     #基础积分
    CurrentUser         = 0                     #当前玩家
    ScoreInfo           = 0                     #叫分信息
    CardData            = 0                     #手上扑克
    UserAutoPlay        = 0                     #玩家托管

class CMD_S_SCENE_Play:
    LandUser            = 0                     #地主玩家
    BombTime            = 0                     #炸弹倍数
    BaseScore           = 0                     #基础积分
    LandScore           = 0                     #地主分数
    LastOutUser         = 0                     #出牌的人
    CurrentUser         = 0                     #当前玩家
    BackCard            = 0                     #底牌扑克
    CardData            = 0                     #手上扑克
    CardCount           = 0                     #扑克数目
    TurnCardCount       = 0                     #基础出牌
    TurnCardData        = 0                     #出牌列表
    UserAutoPlay        = 0                     #玩家托管
    UserDouble          = 0                     #用户加倍

#发送扑克
class CMD_S_SendCard:
    CurrentUser         = 0                     #当前玩家
    CardData            = 0                     #扑克列表
    
#发送扑克
class CMD_S_SendAllCard:
    CurrentUser         = 0                     #当前玩家
    CardData            = 0                     #扑克列表
    BackCard            = 0                     #底牌扑克

#用户叫分
class CMD_S_LandScore:
    LandUser            = 0                     #地主玩家
    CurrentUser         = 0                     #当前玩家
    LandScore           = 0                     #上次叫分
    CurrentScore        = 0                     #当前叫分

#用户倒、反、跟    
class CMD_S_UserDouble:
    LandUser            = 0                     #地主玩家
    CurrentUser         = 0                     #当前玩家
    CurrentUser2        = 0                     #当前玩家
    LandDouble          = 0                     #上次
    CurrentDouble       = 0                     #当前
    State               = 0
    
#游戏开始
class CMD_S_GameStart:
    LandUser            = 0                     #地主玩家
    LandScore           = 0                     #地主分数
    CurrentUser         = 0                     #当前玩家
    BackCard            = 0                     #底牌扑克
    ScoreInfo           = 0                     #
    GameMode            = 0                     #游戏模式(0正常，1移动)
    
#用户出牌    
class CMD_S_OutCard:
    CardCount           = 0                     #出牌数目
    CurrentUser         = 0                     #当前玩家
    OutCardUser         = 0                     #出牌玩家
    TurnIndex           = 0                     #
    CardData            = 0                     #扑克列表
    
#放弃出牌
class CMD_S_PassCard:
    NewTurn             = 0                     #一轮开始
    PassUser            = 0                     #放弃玩家
    CurrentUser         = 0                     #当前玩家
    TurnIndex           = 0                     #
    
#游戏结束
class CMD_S_GameEnd:
    GameTax             = 0                     #游戏税收
    GameScore           = 0                     #游戏积分
    CardCount           = 0                     #扑克数目
    CardData            = 0                     #扑克列表 
    UserDouble          = 0                     #用户加倍
    BombTime            = 0                     #炸弹倍数
    LandScore           = 0                     #地主分数
    Ubi                 = 0                     #U币
    GameGrade           = 0                     #难度
    
########################_#######################_#######################
#客户端命令结构

SUB_C_LAND_SCORE        = 1                     #用户叫分
SUB_C_OUT_CART          = 2                     #用户出牌
SUB_C_PASS_CARD         = 3                     #放弃出牌
SUB_C_TRUSTEE           = 4                     #托管消息
SUB_C_USER_DOUBLE       = 5                     #倒、跟、反

#用户倒、反、跟
class CMD_C_UserDouble:
    Double              = 0                     #当前
    
#托管结构
class CMD_C_UserTrustee:
    UserChairID         = 0                     #玩家椅子
    Trustee             = 0                     #托管标识

#用户叫分
class CMD_C_LandScore:
    LandScore           = 0                     #地主分数
    
#出牌数据包
class CMD_C_OutCard:
    CardCount           = 0                     #出牌数目
    CardData            = 0                     #扑克列表
    



    
    
    
    






























class Cmd(object):
    
    #游戏状态
    
    def __init__(self):
        '''
        Constructor
        '''
        